<WITD application="Work item type editor" version="1.0">
  <WORKITEMTYPE name="Risk">
    <DESCRIPTION>Includes information to track the work to mitigate a risk.</DESCRIPTION>
    <FIELDS>
      <!-- ********** Core fields ******************* -->
      <FIELD name="Id" refname="System.Id" type="Integer">
      </FIELD>
      <FIELD name="Title" refname="System.Title" type="String">
        <HELPTEXT>Short description of the risk used to differentiate it in a list or report</HELPTEXT>
        <REQUIRED/>
      </FIELD>
      <FIELD name="Assigned To" refname="System.AssignedTo" type="String">
        <VALIDUSER/>
      </FIELD>
      <FIELD name="Area Path" refname="System.AreaPath" type="TreePath">
        <HELPTEXT>The area of the product with which this risk is associated</HELPTEXT>
      </FIELD>
      <FIELD name="Iteration Path" refname="System.IterationPath" type="TreePath">
		  <HELPTEXT>The iteration of the product with which this risk is associated</HELPTEXT>
      </FIELD>
      <FIELD name="History" refname="System.History" type="History">
		  <HELPTEXT>Discussion thread and other historical information</HELPTEXT>
      </FIELD>
      <FIELD name="State" refname="System.State" type="String">
		  <HELPTEXT>The workflow state of the risk</HELPTEXT>
      </FIELD>
      <FIELD name="Reason" refname="System.Reason" type="String">
		  <HELPTEXT>The reason why the risk is in the current state</HELPTEXT>
      </FIELD>
      <FIELD name="Changed Date" refname="System.ChangedDate" type="DateTime">
      </FIELD>
      <FIELD name="Changed By" refname="System.ChangedBy" type="String">
        <VALIDUSER/>
      </FIELD>
      <FIELD name="Created Date" refname="System.CreatedDate" type="DateTime">
      </FIELD>
      <FIELD name="Created By" refname="System.CreatedBy" type="String">
      </FIELD>
      <FIELD name="Description" refname="System.Description" type="PlainText">
      </FIELD>
      <!-- *************** Common Fields ****************   -->
      <FIELD name="Issue" refname="Microsoft.VSTS.Common.Issue" type="String" reportable="dimension">
		  <HELPTEXT>Used to highlight the work item, e.g., to mark it as an issue.</HELPTEXT>
        <REQUIRED/>
        <ALLOWEDVALUES>
          <LISTITEM value="Yes"/>
          <LISTITEM value="No"/>
        </ALLOWEDVALUES>
        <DEFAULT from="value" value="No"/>
      </FIELD>
      <FIELD name="Exit Criteria" refname="Microsoft.VSTS.Common.ExitCriteria" type="String" reportable="dimension">
		  <HELPTEXT>Flag to determine if this work item should be tracked on the project checklist.</HELPTEXT>
        <REQUIRED/>
        <ALLOWEDVALUES>
          <LISTITEM value="Yes"/>
          <LISTITEM value="No"/>
        </ALLOWEDVALUES>
        <DEFAULT from="value" value="No"/>
      </FIELD>      
      <FIELD name="State Change Date" refname="Microsoft.VSTS.Common.StateChangeDate" type="DateTime">
        <WHENCHANGED field="System.State">
          <SERVERDEFAULT from="clock"/>
        </WHENCHANGED>
        <WHENNOTCHANGED field="System.State">
          <READONLY/>
        </WHENNOTCHANGED>
      </FIELD>
      <FIELD name="Activated Date" refname="Microsoft.VSTS.Common.ActivatedDate" type="DateTime" reportable="dimension">
        <WHENNOTCHANGED field="System.State">
          <READONLY/>
        </WHENNOTCHANGED>
      </FIELD>
      <FIELD name="Activated By" refname="Microsoft.VSTS.Common.ActivatedBy" type="String" reportable="dimension">
        <WHENNOTCHANGED field="System.State">
          <READONLY/>
        </WHENNOTCHANGED>       
      </FIELD>
      <FIELD name="Resolved Date" refname="Microsoft.VSTS.Common.ResolvedDate" type="DateTime" reportable="dimension">
        <WHENNOTCHANGED field="System.State">
          <READONLY/>
        </WHENNOTCHANGED>
      </FIELD>
      <FIELD name="Resolved By" refname="Microsoft.VSTS.Common.ResolvedBy" type="String" reportable="dimension">
        <WHENNOTCHANGED field="System.State">
          <READONLY/>
        </WHENNOTCHANGED>
      </FIELD>
      <FIELD name="Closed Date" refname="Microsoft.VSTS.Common.ClosedDate" type="DateTime" reportable="dimension">
        <WHENNOTCHANGED field="System.State">
          <READONLY/>
        </WHENNOTCHANGED>        
      </FIELD>
      <FIELD name="Closed By" refname="Microsoft.VSTS.Common.ClosedBy" type="String" reportable="dimension">
        <WHENNOTCHANGED field="System.State">
          <READONLY/>
        </WHENNOTCHANGED>
      </FIELD>
      <FIELD name="Priority" refname="Microsoft.VSTS.Common.Priority" type="Integer" reportable="dimension">
		  <HELPTEXT>Priority for mitigating the risk, based on business goals</HELPTEXT>
        <ALLOWEDVALUES>
          <LISTITEM value="1"/>
          <LISTITEM value="2"/>
          <LISTITEM value="3"/>
        </ALLOWEDVALUES>
        <DEFAULT from="value" value="3"/>
      </FIELD>
      <FIELD name="Rank" refname="Microsoft.VSTS.Common.Rank" type="String" reportable="dimension">
        <HELPTEXT>Stack rank used to prioritize work</HELPTEXT>
      </FIELD>
      <FIELD name="Severity" refname="Microsoft.VSTS.Common.Severity" type="String">
		  <HELPTEXT>How severe is the effect of this risk on the project?</HELPTEXT>
        <REQUIRED/>
        <ALLOWEDVALUES>
          <LISTITEM value="Critical"/>
          <LISTITEM value="High"/>
          <LISTITEM value="Medium"/>
          <LISTITEM value="Low"/>
        </ALLOWEDVALUES>
        <DEFAULT from="value" value="Low"/>
      </FIELD>
      <!-- **************** Build Integration Fields ******************************************************  -->
      <FIELD name="Found In" refname="Microsoft.VSTS.Build.FoundIn" type="String" reportable="dimension">
		  <HELPTEXT>The build in which the bug was encountered</HELPTEXT>
        <SUGGESTEDVALUES>
          <LISTITEM value="&lt;None&gt;"/>
        </SUGGESTEDVALUES>
      </FIELD>
      <FIELD name="Integration Build" refname="Microsoft.VSTS.Build.IntegrationBuild" type="String" reportable="dimension">
		  <HELPTEXT>The build in which the bug was fixed</HELPTEXT>
        <SUGGESTEDVALUES>
          <LISTITEM value="&lt;None&gt;"/>
        </SUGGESTEDVALUES>
      </FIELD>
      <!-- **************** Scheduling Fields *************************************************  -->
      <FIELD name="Remaining Work" refname="Microsoft.VSTS.Scheduling.RemainingWork" type="Double" reportable="measure">
		  <HELPTEXT>An estimate of the number of hours remaining to resolve the risk</HELPTEXT>
      </FIELD>
      <FIELD name="Completed Work" refname="Microsoft.VSTS.Scheduling.CompletedWork" type="Double" reportable="measure">
		  <HELPTEXT>The number of hours that have been spent to resolve this risk</HELPTEXT>
      </FIELD>
      <FIELD name="Baseline Work" refname="Microsoft.VSTS.Scheduling.BaselineWork" type="Double" reportable="measure">
		  <HELPTEXT>The number of hours of work from the baseline plan</HELPTEXT>
      </FIELD>
      <!-- *************** MSF for CMMI PI Fields ****************   -->
      <FIELD name="Blocked" refname="Microsoft.VSTS.CMMI.Blocked" type="String" reportable="dimension">
        <ALLOWEDVALUES>
          <LISTITEM value="Yes"/>
          <LISTITEM value="No"/>
        </ALLOWEDVALUES>
        <DEFAULT from="value" value="No"/>
      </FIELD>
      <FIELD name="Mitigation Triggers" refname="Microsoft.VSTS.CMMI.MitigationTriggers" type="HTML">
		  <HELPTEXT>The mitigation triggers</HELPTEXT>
      </FIELD>
      <FIELD name="Mitigation Plan" refname="Microsoft.VSTS.CMMI.MitigationPlan" type="HTML">
      </FIELD>
      <FIELD name="Contingency Plan" refname="Microsoft.VSTS.CMMI.ContingencyPlan" type="HTML">
      </FIELD>
      <FIELD name="Estimate" refname="Microsoft.VSTS.CMMI.Estimate" type="Double">
		  <HELPTEXT>The estimate for the amount of work (in person hours)</HELPTEXT>
      </FIELD>
      <FIELD name="Probability" refname="Microsoft.VSTS.CMMI.Probability" type="Integer">
		  <HELPTEXT>A percentage indicating the estimated likelihood that the risk will occur</HELPTEXT>
        <REQUIRED/>
      </FIELD>
    </FIELDS>
    <!-- *************** Workflow ****************   -->
    <WORKFLOW>
      <STATES>
        <STATE value="Proposed">
          <FIELDS>
            <FIELD refname="Microsoft.VSTS.Common.ResolvedDate">
              <EMPTY/>
            </FIELD>
            <FIELD refname="Microsoft.VSTS.Common.ResolvedBy">
              <EMPTY/>
            </FIELD>
            <FIELD refname="Microsoft.VSTS.Common.ClosedDate">
              <EMPTY/>
            </FIELD>
            <FIELD refname="Microsoft.VSTS.Common.ClosedBy">
              <EMPTY/>
            </FIELD>
            <FIELD refname="Microsoft.VSTS.Common.ActivatedDate">
              <EMPTY/>
            </FIELD>
            <FIELD refname="Microsoft.VSTS.Common.ActivatedBy">
              <EMPTY/>
            </FIELD>
          </FIELDS>
        </STATE>
        <STATE value="Active">
          <FIELDS>
            <FIELD refname="Microsoft.VSTS.Common.ResolvedDate">
              <EMPTY/>
            </FIELD>
            <FIELD refname="Microsoft.VSTS.Common.ResolvedBy">
              <EMPTY/>
            </FIELD>
            <FIELD refname="Microsoft.VSTS.Common.ClosedDate">
              <EMPTY/>
            </FIELD>
            <FIELD refname="Microsoft.VSTS.Common.ClosedBy">
              <EMPTY/>
            </FIELD>
            <FIELD refname="Microsoft.VSTS.Common.ActivatedDate">
              <REQUIRED/>
            </FIELD>
            <FIELD refname="Microsoft.VSTS.Common.ActivatedBy">
              <REQUIRED/>
            </FIELD>
            <FIELD refname="System.AssignedTo">
              <REQUIRED/>
            </FIELD>
          </FIELDS>
        </STATE>
        <STATE value="Resolved">
          <FIELDS>
            <FIELD refname="Microsoft.VSTS.Common.ClosedDate">
              <EMPTY/>
            </FIELD>
            <FIELD refname="Microsoft.VSTS.Common.ClosedBy">
              <EMPTY/>
            </FIELD>
            <FIELD refname="Microsoft.VSTS.Common.ResolvedDate">
              <REQUIRED/>
            </FIELD>
            <FIELD refname="Microsoft.VSTS.Common.ResolvedBy">
              <REQUIRED/>
            </FIELD>
            <FIELD refname="System.AssignedTo">
              <REQUIRED/>
            </FIELD>
          </FIELDS>
        </STATE>
        <STATE value="Closed">
          <FIELDS>
            <FIELD refname="Microsoft.VSTS.Common.ClosedBy">
              <REQUIRED/>
            </FIELD>
            <FIELD refname="Microsoft.VSTS.Common.ClosedDate">
              <REQUIRED/>
            </FIELD>
            <FIELD refname="System.AssignedTo">
              <EMPTY/>
            </FIELD>
          </FIELDS>
        </STATE>
      </STATES>
      <TRANSITIONS>
        <TRANSITION from="" to="Proposed">
          <REASONS>
            <DEFAULTREASON value="New"/>
          </REASONS>
          <FIELDS>
            <FIELD refname="System.AssignedTo">
              <DEFAULT from="currentuser"/>
            </FIELD>
          </FIELDS>
        </TRANSITION>
        <TRANSITION from="Proposed" to="Active">
          <REASONS>
            <DEFAULTREASON value="Mitigation Triggered"/>
          </REASONS>
          <FIELDS>
            <FIELD refname="Microsoft.VSTS.Common.ActivatedDate">
              <SERVERDEFAULT from="clock"/>
            </FIELD>
            <FIELD refname="Microsoft.VSTS.Common.ActivatedBy">
              <COPY from="currentuser"/>
              <VALIDUSER />
            </FIELD>
          </FIELDS>
        </TRANSITION>
        <TRANSITION from="Active" to="Resolved">
          <REASONS>
            <DEFAULTREASON value="Mitigation Action Complete"/>
          </REASONS>
          <FIELDS>
            <FIELD refname="Microsoft.VSTS.Common.ResolvedDate">
              <SERVERDEFAULT from="clock"/>
            </FIELD>
            <FIELD refname="Microsoft.VSTS.Common.ResolvedBy">
              <COPY from="currentuser"/>
              <VALIDUSER />
            </FIELD>
          </FIELDS>
        </TRANSITION>
        <TRANSITION from="Active" to="Closed">
          <REASONS>
            <DEFAULTREASON value="Overtaken by Events"/>
            <REASON value="Eliminated"/>
            <REASON value="Rejected"/>
          </REASONS>
          <FIELDS>
            <FIELD refname="Microsoft.VSTS.Common.ClosedDate">
              <SERVERDEFAULT from="clock"/>
            </FIELD>
            <FIELD refname="Microsoft.VSTS.Common.ClosedBy">
              <COPY from="currentuser"/>
              <VALIDUSER />
            </FIELD>
          </FIELDS>
        </TRANSITION>
        <TRANSITION from="Resolved" to="Active">
          <REASONS>
            <DEFAULTREASON value="Mitigation Action Unsatisfactory (rework)"/>
          </REASONS>
          <FIELDS>
            <FIELD refname="Microsoft.VSTS.Common.ActivatedBy">
              <COPY from="currentuser"/>
              <VALIDUSER />
            </FIELD>
            <FIELD refname="Microsoft.VSTS.Common.ActivatedDate">
              <SERVERDEFAULT from="clock"/>
            </FIELD>
          </FIELDS>
        </TRANSITION>
        <TRANSITION from="Resolved" to="Closed">
          <REASONS>
            <DEFAULTREASON value="Mitigated"/>
          </REASONS>
          <FIELDS>
            <FIELD refname="Microsoft.VSTS.Common.ClosedDate">
              <SERVERDEFAULT from="clock"/>
            </FIELD>
            <FIELD refname="Microsoft.VSTS.Common.ClosedBy">
              <COPY from="currentuser"/>
              <VALIDUSER />
            </FIELD>
          </FIELDS>
        </TRANSITION>
        <TRANSITION from="Proposed" to="Closed">
          <REASONS>
            <DEFAULTREASON value="Rejected"/>
            <REASON value="Accepted (won't mitigate)"/>
          </REASONS>
          <FIELDS>
            <FIELD refname="Microsoft.VSTS.Common.ClosedDate">
              <SERVERDEFAULT from="clock"/>
            </FIELD>
            <FIELD refname="Microsoft.VSTS.Common.ClosedBy">
              <COPY from="currentuser"/>
              <VALIDUSER />
              <REQUIRED/>
            </FIELD>
          </FIELDS>
        </TRANSITION>
        <TRANSITION from="Closed" to="Active">
          <REASONS>
            <DEFAULTREASON value="Closed in Error"/>
          </REASONS>
          <FIELDS>
            <FIELD refname="Microsoft.VSTS.Common.ActivatedBy">
              <COPY from="currentuser"/>
              <VALIDUSER />
            </FIELD>
            <FIELD refname="Microsoft.VSTS.Common.ActivatedDate">
              <SERVERDEFAULT from="clock"/>
            </FIELD>
            <FIELD refname="System.AssignedTo">
              <COPY from="field" field="Microsoft.VSTS.Common.ClosedBy"/>
            </FIELD>
          </FIELDS>
        </TRANSITION>
      </TRANSITIONS>
    </WORKFLOW>
    <FORM>
      <!-- Guidelines for updating the form section
				 1) All labels should have mnemonics (you must use &amp; not just &)
				 2) No mnemonics on Tabs or Group Boxes
				 3) Labels must use sentence casing (e.g. "Assigned to:" is correct; "Assigned To:" is incorrect)
				 4) No colons in Group Boxes
				 5) Label names should match the field name in whole or in part. They should not be completely different.
				 6) Do not use the same mnemonics on two labels
				 
				 The following mnemonics are common to MSF Agile work items:
				 T -> Title
				 A -> Area
				 I -> Iteration
				 G -> Assigned to
				 S -> State
				 R -> Reason
				 H -> Comment and history
				 U -> Issue
				 B -> Integration build
				 C -> Description
				 K -> Rank
				 O -> Priority
				 
				 The following mnemonics are also used on this work item type
				 V -> Severity
				 D -> Description
				 X -> Exit criteria
				 P -> Probability
			-->
      <Layout>
        <Group>
          <Column PercentWidth="70">
            <Control Type="FieldControl" FieldName="System.Title" Label="&amp;Title:" LabelPosition="Left"/>
          </Column>
          <Column PercentWidth="30">
            <Control Type="FieldControl" FieldName="Microsoft.VSTS.CMMI.Probability" Label="&amp;Probability:" LabelPosition="Left"/>
          </Column>
        </Group>
        <Group Label="Classification">
          <Column PercentWidth="100">
            <Control Type="WorkItemClassificationControl" FieldName="System.AreaPath" Label="&amp;Area path:" LabelPosition="Left"/>
            <Control Type="WorkItemClassificationControl" FieldName="System.IterationPath" Label="&amp;Iteration path:" LabelPosition="Left"/>
          </Column>
        </Group>
        <Group Label="Status">
          <Column PercentWidth="50">
            <Control Type="FieldControl" FieldName="System.AssignedTo" Label="Assi&amp;gned to:" LabelPosition="Left"/>
            <Control Type="FieldControl" FieldName="Microsoft.VSTS.Common.Priority" Label="&amp;Priority:" LabelPosition="Left"/>
            <Control Type="FieldControl" FieldName="Microsoft.VSTS.Common.Severity" Label="&amp;Severity:" LabelPosition="Left"/>
          </Column>
          <Column PercentWidth="50">
            <Control Type="FieldControl" FieldName="Microsoft.VSTS.CMMI.Blocked" Label="&amp;Blocked:" LabelPosition="Left"/>
            <Control Type="FieldControl" FieldName="System.State" Label="&amp;State:" LabelPosition="Left"/>
            <Control Type="FieldControl" FieldName="System.Reason" Label="&amp;Reason:" LabelPosition="Left"/>
          </Column>
        </Group>
        <TabGroup>
          <Tab Label="Description">
            <Control Type="HtmlFieldControl" FieldName="System.Description" Label="Des&amp;cription:" LabelPosition="Top" Dock="Fill"/>
          </Tab>
          <Tab Label="Mitigation">
            <Group>
              <Column PercentWidth="100">
                <Control Type="HtmlFieldControl" FieldName="Microsoft.VSTS.CMMI.MitigationPlan" Label="&amp;Plan:" LabelPosition="Top" Dock="Fill"/>
                <Control Type="HtmlFieldControl" FieldName="Microsoft.VSTS.CMMI.MitigationTriggers" Label="&amp;Triggers:" LabelPosition="Top" Dock="Fill"/>
              </Column>
            </Group>
          </Tab>
          <Tab Label="Contingency Plan">
            <Control Type="HtmlFieldControl" FieldName="Microsoft.VSTS.CMMI.ContingencyPlan" Label="&amp;Contingency plan:" LabelPosition="Top" Dock="Fill"/>
          </Tab>
          <Tab Label="History">
            <Control Type="WorkItemLogControl" FieldName="System.History" Label="&amp;History:" LabelPosition="Top" Dock="Fill"/>
          </Tab>
          <Tab Label="Links">
            <Control Type="LinksControl"/>
          </Tab>
          <Tab Label="Attachments">
            <Control Type="AttachmentsControl"/>
          </Tab>
          <Tab Label="Details">
            <Group>
              <Column PercentWidth="100">
                <Group Label="Schedule">
                  <Column PercentWidth="100">
                    <Control Type="FieldControl" FieldName="Microsoft.VSTS.CMMI.Estimate" Label="&amp;Estimate:" LabelPosition="Left"/>
                    <Control Type="FieldControl" FieldName="Microsoft.VSTS.Scheduling.RemainingWork" Label="&amp;Remaining work:" LabelPosition="Left"/>
                    <Control Type="FieldControl" FieldName="Microsoft.VSTS.Scheduling.CompletedWork" Label="&amp;Completed work:" LabelPosition="Left"/>
                  </Column>
                </Group>
              </Column>
            </Group>
          </Tab>
        </TabGroup>
      </Layout>
    </FORM>
  </WORKITEMTYPE>
</WITD>
